window.onerror = function (errorMsg, url, lineNumber, column, errorObj) {
    var app = window.document.getElementById("app");
    var h1 = window.document.createElement("h1");
    h1.style.color = "red";
    h1.style.fontSize = "24px";
    h1.innerText =
        "错误: " +
        errorMsg +
        ", 脚本: " +
        url +
        ", 行数: " +
        lineNumber +
        ", 列数: " +
        column +
        ", 追踪栈: " +
        errorObj;
    app.appendChild(h1);
};

console.error = function (message, args) {
    var app = window.document.getElementById("app");
    var h1 = document.createElement("h1");
    h1.style.color = "red";
    h1.style.fontSize = "24px";
    h1.innerText = message;
    app.appendChild(h1);
};
